package _1010.funcref;

import org.junit.Test;

public class StaticMethodRefDemo {

	interface Message{
		double convert(double t); // Double convert(Double t);
	}
	
	@Test
	public void t1() {
		Message m1 = Math::abs;
		System.out.println(m1.convert(-5));  // Math.abs(-5);
		
		Message m2 = Math::floor;
		System.out.println(m2.convert(1.9)); // Math.floor(1.9);
	}
	
	interface Message2<T,R>{
		R convert(T t);
	}
	
	@Test
	public void t2() {
		Message2<Float,Integer> m = Math::round; 
		System.out.println(m.convert(1.51F));  // Math.round(1.51F); 
	}
}
